package com.suzhe.ymall.product.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.LinkedHashMap;

/**
 * <p>
 * sku表
 * </p>
 *
 * @author suzhe
 * @since 2019-07-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "Sku对象", description = "sku表")
public class Sku implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "spu id")
    private Integer spuId;

    @ApiModelProperty(value = "商品标题")
    private String title;

    @ApiModelProperty(value = "销售价格，单位为分")
    private Long price;

    @ApiModelProperty(value = "销售属性组合key")
    private String attrKey;

    @ApiModelProperty(value = "销售属性组合")
    @JsonIgnore
    private String attr;

    @ApiModelProperty(value = "商家编码")
    private String skuCode;

    @ApiModelProperty(value = "商品图片")
    private String imgUrl;

    @ApiModelProperty(value = "是否有效，0无效，1有效")
    private Boolean enable;

    @JsonIgnore
    @TableLogic
    private Boolean deleted;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    private Date updateTime;


    @TableField(exist = false)
    @ApiModelProperty(value = "销售属性")
    private LinkedHashMap<String,String> attrMap;


    @TableField(exist = false)
    @ApiModelProperty(value = "库存")
    private Integer stock;


}
